package xyz.xuminghai.javafx_learn.scene.control;

import javafx.application.Application;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Separator;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

/**
 * 2023/5/20 2:15 星期六<br/>
 * 分隔器
 *
 * @author xuMingHai
 */
public class SeparatorApp extends Application {

    private final VBox vbox = new VBox();

    public static void main(String[] args) {
        Application.launch(args);
    }

    @Override
    public void init() {
        Button button1 = new Button("button1");
        Button button2 = new Button("button2");
        Button button3 = new Button("button3");
        Button button4 = new Button("button4");

        Separator separator = new Separator();

        vbox.setAlignment(Pos.CENTER);
        vbox.getChildren().addAll(button1, button2, button3, separator, button4);
    }

    @Override
    public void start(Stage primaryStage) {
        primaryStage.setTitle(getClass().getSimpleName());
        Scene scene = new Scene(vbox, 800, 600);
        primaryStage.setScene(scene);
        primaryStage.show();
    }
}
